import request from '@/utils/request.js'

//获取当前施工人员所在项目组
export function pageProject(data) {
  return request({
    url: `business/app/buildpost/pageProject`,
    method: 'GET',
		params:data,
  })
}

//获取当前施工人员所在子项目
export function pageSubProject(data) {
  return request({
    url: `business/app/buildpost/pageSubProject`,
    method: 'GET',
		params:data,
  })
}

//查询子项目数量
export function countSubProject(data) {
  return request({
    url: `business/report/app/countSubProject`,
    method: 'POST',
		params:data,
  })
}

//查询测点数量
export function countPoints(data) {
  return request({
    url: `business/report/app/countPoints`,
    method: 'POST',
		params:data,
  })
}

//工序ID获取子项目工序详情
export function process(subProjectId,processId) {
  return request({
    url: `business/app/buildpost/process/`+subProjectId+'/'+processId,
    method: 'GET',
  })
}
// 获取项目基础信息
export function projectInfo(projectId) {
  return request({
    url: `business/project/info/`+projectId,
    method: 'GET',
  })
}

// 获取子项目基础信息
export function subProjectInfo(subProjectId) {
  return request({
    url: `business/project/subproject/detail/`+subProjectId,
    method: 'GET',
  })
}

// 获取项目基础信息对应的单位名称
export function entityType() {
  return request({
    url: `admin/dict/type/entity_type`,
    method: 'GET',
  })
}

// 根据子项目ID和子工序ID获取已添加设备列表
export function buildpost(data) {
  return request({
    url: `business/app/buildpost/list`,
    method: 'GET',
		params:data
  })
}

// 分页获取规范管理模板
export function standard(data) {
  return request({
    url: `business/standard/page`,
    method: 'GET',
		params:data
  })
}

//获取规范管理模板详情
export function standardList(data) {
  return request({
    url: `business/standard/info/${data}`,
    method: 'GET',
		loading: true
  })
}

//新增施工上报
export function buildSave({data, submitFlag}) {
	console.log(data)
	console.log(submitFlag)
  return request({
    url: `business/app/buildpost/save/${submitFlag}`,
    method: 'POST',
		params:data
  })
}
//修改施工上报
export function updateBuild({data, submitFlag}) {
  return request({
    url: `business/app/buildpost/update/${submitFlag}`,
    method: 'PUT',
		params:data
  })
}
//删除施工上报
export function delBuild(ids) {
  return request({
    url: `business/app/buildpost/delete`+'?ids='+ids,
    method: 'DELETE'
  })
}

//提交审核
export function submitReview(data) {
  return request({
    url: `business/report/app/submit`,
    method: 'POST',
		params:data
  })
}

//工序进度查询
export function progress(detailedProId) {
  return request({
    url: `business/report/app/progress/${detailedProId}`,
    method: 'GET',
  })
}

//工序驳回原因查询
export function auditReason(standardProId) {
  return request({
    url: `business/report/app/auditReason/${standardProId}`,
    method: 'GET',
  })
}

//后续工序选择设备
export function selectEquipment(data) {
  return request({
    url: `business/app/buildpost/selectEquipment`,
    method: 'POST',
		params:data,
		header:{
			'content-type':'application/x-www-form-urlencoded'
		}
  })
}

//根据id获取考核模板
export function zdhjcsubassessment(data) {
  return request({
    url: `business/zdhjcassessment/page`,
    method: 'GET',
		params:data
  })
}

//查询水印
export function waterManagement(id) {
  return request({
    url: `business/zdhjcWatermarkManagement/get/${id}`,
    method: 'GET',
  })
}
